<template>
    <bm-overlay pane="labelPane" class="selfSample" @draw="drawSelf">
            <!-- 主用户头像 -->
        <div>
            <yd-icon  name="uphoto"  custom slot="icon" size=".4rem" color='#ff4081'></yd-icon>
        </div>
    </bm-overlay>
</template>
<script>
export default {
    props:['position'],
    methods:{
        drawSelf ({el, BMap, map}) {
            const {lng, lat} = this.position
            const pixel = map.pointToOverlayPixel(new BMap.Point(lng, lat))
            el.style.left = pixel.x - 24 + 'px'
            el.style.top = pixel.y - 20 + 'px'
        },
    },
    mounted(){
   
    }
}
</script>
<style lang="less">
.selfSample{
       position: absolute;
       div{
           width: .88rem;
           height: .88rem;
           border-radius: 50%;
           border: .05rem solid #ff4081;
           line-height: .8rem;
           text-align: center
       }
}
</style>

